package com.logic.modular.game.battle.info;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class FiledName {
    // 战斗阶段映射表
    public static final Map<Integer, String> phaseMap = Collections.unmodifiableMap(new HashMap<Integer, String>() {{
        // 0:    战斗中
        put(0, "战斗中");
        put(10, "战斗前准备");
        // 11.阵营加成
        put(11, "阵营加成");
        // 12.兵种加成
        put(12, "兵种加成");
        // 13.羁绊连携
        put(13, "羁绊连携");
        // 14.被动战法
        put(14, "被动战法");
        // 15.指挥战法
        put(15, "指挥战法");
        // 20:   回合前准备
        put(20, "回合前准备");
        // 21:   武将行动前
        put(21, "武将行动前");
        // 22:   武将开始行动
        put(22, "武将开始行动");
    }});

    // 事件类型映射表
    public static final Map<Integer, String> eventMap = Collections.unmodifiableMap(new HashMap<Integer, String>() {{
        put(-1, "主动战法");
        put(-2, "被动战法");
        put(-3, "指挥战法");
        put(-4, "追击战法");
        put(-5, "天赋战法");
    }});

    // 技能类型映射表
    public static final Map<Integer, String> SKILL_TYPE_MAP = Collections.unmodifiableMap(new HashMap<Integer, String>() {{
        put(1, "主动");
        put(2, "被动");
        put(3, "指挥");
        put(4, "追击");
    }});

    public static final Map<Integer, String> SKILL_FAIL_REASON = Collections.unmodifiableMap(new HashMap<Integer, String>() {{
        // 触发
        put(-1,"非可触发回合");
        put(-2,"非可触发阶段");
        put(-3,"不满足触发局内效果次数");
        put(-4,"不满足触发回合内效果次数");
        put(-6,"不满足触发事件");
        put(-8,"概率未触发");
        // 冲突
        put(-11,"类型冲突");
        put(-12,"数值冲突");
        //触发
    }});
    private static final Logger log = LoggerFactory.getLogger(FiledName.class);

    public static void logSkillFailReason(Integer failReason) {
        log.info("技能释放失败,原因:{}", SKILL_FAIL_REASON.get(failReason));
    }
    public static void logAllSkillFailReason(List<Integer> failReasonList) {
        List<String> collect = failReasonList.stream().map(SKILL_FAIL_REASON::get).collect(Collectors.toList());
        log.info("技能释放失败,原因列表:{}", collect);
    }

}
